package com.feicheng.controller.main.admin.setting;


import com.feicheng.common.result.ResultInfo;
import com.feicheng.persistence.entity.Cron;
import com.feicheng.persistence.entity.Order;
import com.feicheng.persistence.mapper.CronMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("/main/admin/setting")
@RequestMapping("/main/admin/setting")
public class CronController {

    @Autowired
    CronMapper cronMapper;

    @GetMapping("/cron")
    public ResultInfo getCron() {
        return ResultInfo.success(cronMapper.selectById(1));
    }

    @PostMapping("/cron")
    public ResultInfo updateCron(@RequestBody Cron cron) {
        cronMapper.updateById(cron);
        return ResultInfo.success();
    }
}
